package com.lu.pojo.oop.classes;

import java.util.List;

public class Administrator {
    private String name;
    private String password;


    public Administrator(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public String getName() {
        return name;
    }



    public boolean checkPassword(String pwd){
        return this.password.equals(pwd);
    }

    public boolean changePassword(String oldPwd,String newPwd){

        if (!oldPwd.equals(this.password)){
            System.out.println("密码错误，您没有权限更改！");
            return false;
        }
        this.password=newPwd;
        System.out.println("密码，更新成功！");
        return true;
    }
}
